package cn.chenxinjie.hrm.feign;

import cn.chenxinjie.hrm.domain.LoginUser;
import cn.chenxinjie.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author 陈鑫杰
 * @date 2022/3/18 17:35
 */
@Component
public class LoginUserFallBack implements FallbackFactory<LoginUserFeign> {
    @Override
    public LoginUserFeign create(Throwable throwable) {
        return new LoginUserFeign() {
            @Override
            public AjaxResult entering(LoginUser loginUser) {
                return AjaxResult.me().setSuccess(false).setResultObj("系统繁忙,稍后重试!");
            }
        };
    }
}
